
/***产品，服务分类列表****/

import debug from "../debug/Debug.js";
var cList = {
	list:[],
} 

/***单据按钮数据处理逻辑****/

/****设置分类列表数据****/
cList.setList = function(data)
{
	this.list = data;
}

/***获取整个分类列表***/
cList.getList = function()
{
	return this.list;
}

/***获取一级分类 fid:0***/
cList.getFirstCat = function()
{
	let i,len = this.list.length;
	let arr = [];
	for(i=0; i<len; i++)
	{
		let data = this.list[i];
		if(data.fid == 0)//
		{
			console.log("一级分类===========",data)
			arr.push(data);
		}
	}
	return arr;
}

/***获取分类****/
cList.getSubCat = function(fid)
{
	let i,len = this.list.length;
	let arr = [];
	for(i=0; i<len; i++)
	{
		let data = this.list[i];
		if(data.fid == fid)//
		{
			arr.push(data);
		}
	}
	return arr;
}

export default cList;

